import 'package:flutter/material.dart';
import 'package:flutter_demo/test/test3.dart';
import 'package:flutter_demo/tmac/secondPage.dart';



class FirstPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: "首页",
      home: new PageWidgetFull(),
    );
  }
}

class PageWidgetFull extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return new PageState();
  }
}

class PageState extends State {
  var respond = "";

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      body:
      new SafeArea(child: new Padding(padding: EdgeInsets.only(top: 100),child:
      new Column(
        children: <Widget>[
          new FlatButton(
              onPressed: () async {
                var _respond = await Navigator.push(
                    context, MaterialPageRoute(builder: (context) {
                  return new MainPage(title: "第一个页面传值");
                }));

                setState(() {
                  respond = _respond;
                });
              },
              child: Text("跳转")),
          Text("第二个页面返回值$respond")
        ],
      ),))
     ,
    );
  }
}
